package com;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet(name = "oneServlet")
public class oneServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("asfaf");
        student s1=new student("李文丰",1);
        student s2=new student("王鱼",2);
        List<student>list=new ArrayList<>();
        list.add(s1);
        list.add(s2);
        request.setAttribute("key",list);

        request.getRequestDispatcher("/usershow.jsp").forward(request,response);
    }
}
